﻿#include "GameScene.h"
#include "SpritePlayer.h"
#include "Start.h"
USING_NS_CC;
bool GameScene::init()
{
  vs = Director::getInstance()->getWinSize();
  initBackground();
  initGround();
  initPlayer();
  initStar();

  return true;
}

void GameScene::onExit()
{
  Scene::onExit();
  this->cleanup();
}

void GameScene::initBackground()
{
  background = Sprite::create("background.jpg");
  background->setPosition(vs.width / 2, vs.height / 2);
  background->setScale(1.3f);
  this->addChild(background);
}

void GameScene::initGround()
{
  background = Sprite::create("ground2.png");
  background->setPosition(vs.width / 2, vs.height / 2  - 100);
  //background->setScale(1);
  this->addChild(background);
}

void GameScene::initPlayer()
{
  player = PlayerSprite::create();
  this->addChild(player);
}

void GameScene::initStar()
{
  star = Start::create(player);
  this->addChild(star);
}
